<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
	<xsl:template match="/">
		<infopost-request>
			<xsl:for-each select="InsuReq">
				<request-head>
					<xsl:for-each select="Main">
						<trans-id>
							<xsl:value-of select="TransNo"/>
						</trans-id>
						<trans-type>102</trans-type>
						<insu-id>
							<xsl:value-of select="InsuId"/>
						</insu-id>
						<trans-date>
							<xsl:value-of select="TranDate"/>
						</trans-date>
						<trans-time>
							<xsl:value-of select="TranTime"/>
						</trans-time>
						<area>
							<xsl:value-of select="ZoneNo"/>
						</area>
						<bank>209</bank>
						<branch/>
						<post>
							<xsl:value-of select="BrNo"/>
						</post>
						<agency-hand>
							<xsl:value-of select="TellerNo"/>
						</agency-hand>
						<xsl:call-template name="sourceTypeCode">
							<xsl:with-param name="srcCode" select="Channel"/>
						</xsl:call-template>
						<authorized>life</authorized>
						<column5>
							<xsl:value-of select="PayAcc"/>
						</column5>
					</xsl:for-each>
				</request-head>
				<request-newbiz>
					<request-policy-issue>
						<apply-code>
							<xsl:value-of select="Main[1]/ApplyNo"/>
						</apply-code>
						<uw-trans-id>
							<xsl:value-of select="Main[1]/OriginTransNo"/>
						</uw-trans-id>
						<print-code>
							<xsl:value-of select="Main[1]/PrintNo"/>
						</print-code>
						<premium>
							<xsl:value-of select="Main[1]/Premium"/>
						</premium>
					</request-policy-issue>
				</request-newbiz>
			</xsl:for-each>
		</infopost-request>
	</xsl:template>
	<xsl:template name="sourceTypeCode">
		<xsl:param name="srcCode"/>
		<xsl:choose>
			<xsl:when test="$srcCode = '4'">
				<source-type>8</source-type>
			</xsl:when>
			<xsl:otherwise>
				<source-type>0</source-type>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
</xsl:stylesheet>
